<?php echo $this->Session->flash(); ?>
<script>

$(document).ready(function(){
        selectDiv();
        $('#tipo1').change(function() {
            selectDiv();


        });


    });
    
    function selectDiv(){
        
        if($('#tipo1 option:selected').val()=='Otra'){
            $('#cual1').show("slow");
            
        }else{
            $('#cual1').hide("slow");
            $('#WaterPollOtroCual').attr('value','');
        }
        
    } 

</script>
<div  id="loadvc" style="display: none;">
    <?php echo $html->image('loading.gif', array('border' => "0", 'align' => 'center')); ?>
</div>

<?php echo $form->create('ProductiveVocations',array('action'=>'add'));  ?>
<?php echo $form->hidden("ProductiveVocation.poll_id");?>
<?php echo $form->input("ProductiveVocation.tipo",array('options'=>array(''=>'Seleccione', 'Agricola'=>'Agricola','Pecuaria'=>'Pecuaria','Forestal'=>'Forestal','Acuicola'=>'Acuicola','Otra'=>'Otra'),'label'=>'Vocacion','id'=>'tipo1' ));?>
<div  id="cual1" style="display: none;">
    <?php  echo $form->input("ProductiveVocation.otro_cual"); ?>
</div>
<?php echo $form->input("ProductiveVocation.hectareas");?>

<?php echo $ajax->submit('Guardar', array('url' => array('controller' => 'ProductiveVocations', 'action' => 'edit',$this->data['ProductiveVocation']['id']), 'update' => 'vocacion', 'indicator' => 'loadvc'));?>
<?php echo $form->end();  ?>